<%@page contentType="text/html"%>
<%@page pageEncoding="UTF-8"%>
<%@include file="/includes.jsp"%>

<% int total = ((Integer)session.getAttribute("total")).intValue(); %>
<% total = total != 0? total: 1; %>
<jsp:useBean id="durationHours" class="java.util.Date"/>
<jsp:useBean id="durationMins" class="java.util.Date"/>
<jsp:useBean id="remainingHours" class="java.util.Date"/>
<jsp:useBean id="remainingMins" class="java.util.Date"/>
        
<div class="layout">
    <table class="styled" cellspacing="0">
        <tr>
            <th class="styled">Date</th>
            <th class="styled">Duration</th>
            <th class="styled">Remaining</th>
            <th class="styled">Graphical</th>
        </tr>
        <logic:iterate name="burnDownValue" id="time">
            <tr>
                <td class="styled"><beans:write name="time" property="date"/></td>
                <jsp:setProperty name="durationHours" property="time" value="<%=((BurnDownDTO)time).getDuration_min()/60%>"/>
                <jsp:setProperty name="durationMins" property="time" value="<%=((BurnDownDTO)time).getDuration_min()%60%>"/>
                <td class="styled"><beans:write name="durationHours" property="time" format="##"/>h:<beans:write name="durationMins" property="time" format="00"/>m</td>
                <jsp:setProperty name="remainingHours" property="time" value="<%=((BurnDownDTO)time).getRemaining_min()/60%>"/>
                <jsp:setProperty name="remainingMins" property="time" value="<%=((BurnDownDTO)time).getRemaining_min()%60%>"/>
                <td class="styled"><beans:write name="remainingHours" property="time" format="##"/>h:<beans:write name="remainingMins" property="time" format="00"/>m</td>
                <td class="styled">
                    <div class="histogram" style="float: left; width: <%=((BurnDownDTO)time).getDuration_min()*100/total%>%">&nbsp;</div>
                    <div class="histogram-remaining" style="float: left; width: <%=((BurnDownDTO)time).getRemaining_min()*100/total%>%">&nbsp;</div>
                </td>
            </tr>
        </logic:iterate>
    </table>
</div>